import { useDispatch } from "react-redux";
import { editActions } from "./edit.slice";

export const useShowEditModal = () => {
  const dispatch = useDispatch();
  return (id: number | undefined = undefined) => {

    dispatch(editActions.onSetEditContentId(id));
    dispatch(editActions.onShowEditModal());
  };
};
export const useCloseEditModal = () => {
  const dispatch = useDispatch();
  return () => {
    dispatch(editActions.onSetEditContentId(-1));
    dispatch(editActions.onCloseEditModal());
  };
};
